/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package posicion;

import java.io.Serializable;
import javax.persistence.Entity; //Pasa clase a tabla
import javax.persistence.Id;
import javax.persistence.GeneratedValue; //Forma que se generan los ids
import javax.persistence.GenerationType; //Typos de datos

import javax.persistence.Table; //Personalizar nombre de tabla sino idem class
import javax.persistence.Transient; //para atributos que se equiran NO persistir
import javax.persistence.Column; //Personalizar nombre de columna en tabla sino idem class

import javax.persistence.CascadeType;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.ManyToMany;
import javax.persistence.JoinColumn;

import java.util.List;
import java.util.ArrayList;
import org.hibernate.*;

/**
 *
 * @author martin
 */
@Entity
public class Test implements Serializable  {
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private long idTest;
    private String algo;

    public long getIdTest() {
        return idTest;
    }

    public void setIdTest(long idTest) {
        this.idTest = idTest;
    }

    public String getAlgo() {
        return algo;
    }

    public void setAlgo(String algo) {
        this.algo = algo;
    }
    
    public Test () {
        
    }
    
    public void persist () {
        Session session = HibernateUtils.getMySession();
        session.beginTransaction();
        session.persist(this);
        session.getTransaction().commit();
    }
}
